package util;

import java.text.DateFormat;

/**
 * Formats Date for certain Locale
 * 
 * @author MK
 * 
 */
public class DateFormatting {

	public static final DateFormat DATE_TIME_INSTANCE = DateFormat
			.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT);;

	public static String toFormattedStringDateAndTime(Long dateAsLong) {

		DateFormat dateFormatter = DATE_TIME_INSTANCE;
		String date = dateFormatter.format(dateAsLong);
		return date;
	}

	public static String toFormattedStringLong(Long dateAsLong) {
		DateFormat dateFormatter = DateFormat.getDateTimeInstance(
				DateFormat.FULL, DateFormat.FULL);
		String date = dateFormatter.format(dateAsLong);

		return date;
	}

	public static String toFormattedStringOnlyDate(long dateAsLong) {
		DateFormat dateFormatter = DateFormat
				.getDateInstance(DateFormat.MEDIUM);
		String date = dateFormatter.format(dateAsLong);
		return date;
	}
}